package com.dsh.userSetting.dao;

import com.dsh.userSetting.entity.vo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface AgreementDao {
    /**
     * 查询用户注册
     *
     * @return
     */
    UserAgreementVo selectUserAgreement();

    void updateUserAgreement(UserAgreementVo userAgreementVo);

    void insertUserAgreement(UserAgreementVo userAgreementVo);

    UserPrivacyVo selectUserPrivacy();

    void updateUserPrivacy(UserPrivacyVo userPrivacyVo);

    void insertUserPrivacy(UserPrivacyVo userPrivacyVo);

    UserRechargeVo selectUserRecharge();

    void updateUserRecharge(UserRechargeVo userRechargeVo);

    void insertUserRecharge(UserRechargeVo userRechargeVo);

    UserLevelVo selectUserLevel();

    void updateUserLevel(UserLevelVo userLevelVo);

    void insertUserLevel(UserLevelVo userLevelVo);

    UserUpgradeVo selectUserUpgrade();

    void updateUserUpgrade(@Param("userUpgradeVo") UserUpgradeVo userUpgradeVo);

    void insertUserUpgrade(@Param("userUpgradeVo") UserUpgradeVo userUpgradeVo);

    /**
     * 查询全部的会员升级规则
     *
     * @return
     */
    List<ConditionsVo> selectAll();

    /**
     * 增加会员升级规则
     */
    int insertRule(ConditionsVo conditionsVo);

    /**
     * 根据id査找升级规则
     *
     * @param id
     * @return
     */
    ConditionsVo selectAllById(int id);

    /**
     * 修改规则
     *
     * @param id
     * @return
     */
    int updateRule(@Param("conditionsVo") ConditionsVo conditionsVo);

    /**
     * 查找全部的策略
     */
    List<StrategyVo> selectAllStrategy();

    /**
     * 根据策略id查询充值赠送集合
     */
    List<RechargeAndGiftVo> selectRechargeAndGiftBySId(@Param("sId") int sId);

    /**
     * 修改充值赠送
     */
    void updateRechargeAndGift(@Param("rechargeAndGiftVo") RechargeAndGiftVo rechargeAndGiftVo);

    /**
     * 根据adminId查询所在的机构
     */
    List<AreaByAdminVo> selectAreaByAdminId(@Param("uId") int uId);

    /**
     * 根据片区id查询门店
     */
    List<StoreAndAreaVo> selectStoreByAreaId(@Param("aId") int aId);

    /**
     * 修改门店所对应的策略
     */
    void updateStrategyToStore(@Param("storeAndAreaVo") StoreAndAreaVo storeAndAreaVo);
}
